﻿using System;
using System.Collections.Generic;
using System.Xml.Serialization;
using System.Text;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
using System.Threading.Tasks;

namespace Molia.AccountServer
{
    [Serializable]
    class Theme
    {
        public string Data;
    }
    class Program
    {
        static void Main(string[] args)
        {
            Theme t = new Theme() { Data = "Hello Net!" };
            XmlSerializer serial = new XmlSerializer(typeof(string));
            MemoryStream ms = new MemoryStream();
            serial.Serialize(ms, t);
            ms.Flush();
            ms.Position = 0;
            var data = new byte[ms.Length];
            ms.Read(data, 0, data.Length);
            var str = Encoding.UTF8.GetString(data);
            ms.Position = 0;
            var obj = serial.Deserialize(ms);
        }
    }
}
